<ul>
<?php
$tags = sqlite_fetch_all(sqlite_query($db,"SELECT DISTINCT tags FROM pages"));
$taglist = array();
// get all the tags
foreach($tags as $post) {
  $posttags = split(" ",$post[0]);
  foreach($posttags as $tag) {
	  $taglist[$tag] += 1;
  }
}
// print 'em out
for($i=0; $i<count($taglist); $i++) {
  $biggest = 40;
  $most = 0;
	$tag = each($taglist);
	if($tag['value'] > $most) {
	  $most = $tag['value'];
	}
	$size = ($biggest/1.5-$most)*$tag['value'];
	$tagname = $tag['key'];
	echo "<a href='?tag=$tagname' style='font-size: ".round($size)."pt'>$tagname </a>\n";
}
?>
</ul>